package com.ffyc.ssm.controller;

import com.ffyc.ssm.common.CommonResult;
import com.ffyc.ssm.modle.Link;
import com.ffyc.ssm.service.Front_LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(path="/front_LinkController")
public class Front_LinkController {

    @Autowired
    Front_LinkService front_adService;

    @GetMapping(path = "/getLink")
    public CommonResult getLink(){
        CommonResult commonResult;
        try{
            List<Link> linkList= front_adService.getLink();
            commonResult=new CommonResult(200,"查询成功",linkList);
        }catch(Exception e){
            commonResult=new CommonResult(500,"查询失败",null);
        }
        return commonResult;
    }
}
